package test;

public class code3{
    public static void main(String[] args){
        int[][] scores = {{85,92,78,90},{76,88,95,82},{91,79,83,89}};
        int[] sum = {0,0,0,0};
        double[] avg = {0,0,0,0};
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 4; j++){
                sum[i] += scores[i][j];
                sum[3] += scores[i][j];
            }
            avg[i] = sum[i] / 4.0;
        }
        avg[3] = sum[3] / 12.0;
        for(int i = 0; i < 3; i++){
            System.out.println("第1组总分：" + sum[i] + "，平均分：" + (int)(avg[i]*10)/10.0);
        }
        System.out.println("全班总分：" +  sum[3] + "，平均分：" + (int)(avg[3]*10)/10.0);
    }
}